package 创建型模式.工厂方法模式.简单工厂模式;

public class SimpleFactory 
{
	public static Product getProduct(String type)
	{
		switch (type) {
			case "cmp" -> {
				return new Computer();
			}
			case "tv" -> {
				return new Television();
			}
			default -> {
				return null;
			}
		}
	}
}
